package com.hqully.smartfumehood.common.websocket;



import com.google.gson.Gson;

import javax.websocket.EndpointConfig;


/**
 * <p>
 *     自定义websocket编解码类
 * </p>
 * @author liulingyu
 * @date 2022-05-18 19:44
 * @version 1.0
 */
public class UserWebSocketEncoder implements javax.websocket.Encoder.Text<Object> {
    @Override
    public String encode(Object object) {
        return new Gson().toJson(object);
    }

    @Override
    public void init(EndpointConfig endpointConfig) {

    }

    @Override
    public void destroy() {

    }
}
